import os
import copy
from paste.script.templates import var
from pylons.util import PylonsTemplate

class PlyneTemplate(PylonsTemplate):
    _template_dir = 'templates/default_project'
    summary = "A Plyne project"
    required_templates = ['pylons']
    use_cheetah = False
    vars = copy.deepcopy(PylonsTemplate.vars)
    vars.insert(1, var('mirrordb_url',
                       'URL for the content mirror db',
                       default=''))

    def post(self, command, output_dir, vars):
        path = os.path.join(output_dir,
                            vars['package'],
                            'public')
        os.remove(os.path.join(path, 'index.html'))

        super(PylonsTemplate, self).post(command, output_dir, vars)
